Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: provide coinbase proof #505

Merged
merged 1 commit into from
Jul 27, 2023
Merged

fix: provide coinbase proof #505

merged 1 commit into from
Jul 27, 2023

Conversation

sander2
Copy link
Member

@sander2 sander2 commented Jul 25, 2023

Closes #501

@sander2 sander2 force-pushed the spv-fix branch 2 times, most recently from 7b8efdc to 1550ff9 Compare July 26, 2023 16:08
bitcoin/src/lib.rs Show resolved Hide resolved
runtime/Cargo.toml Outdated Show resolved Hide resolved
Comment on lines +195 to +208
// construct height: see https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki
// first byte is number of bytes in the number (will be 0x03 on main net for the next
// 150 or so years with 223-1 blocks), following bytes are little-endian representation
// of the number (including a sign bit)
let mut height_bytes = height.to_le_bytes().to_vec();
for i in (1..4).rev() {
// remove trailing zeroes, but always keep first byte even if it's zero
if height_bytes[i] == 0 {
height_bytes.remove(i);
} else {
break;
}
}
height_bytes.insert(0, height_bytes.len() as u8);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not use the logic in the parsing crate here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess technically yes, but (1) it's not exposed and (2) we're not using the parachain's bitcoin types here, but rather the types used by the bitcoin core rpc. Both of these are not hard blockers but I think it makes it not worth it

@gregdhill gregdhill merged commit f9c1578 into interlay:master Jul 27, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Submit coinbase proofs for issue, redeem and replace
2 participants